﻿using System;
using Character;
using UnityEngine;

// Token: 0x020001B6 RID: 438
public class CutAct_CharaShow : CutAction
{
	// Token: 0x06000B63 RID: 2915 RVA: 0x0004289C File Offset: 0x00040A9C
	public CutAct_CharaShow(CutScene cutScene) : base(cutScene, CUTACT.CHARASHOW)
	{
	}

	// Token: 0x06000B64 RID: 2916 RVA: 0x00042900 File Offset: 0x00040B00
	public override object Clone()
	{
		return new CutAct_CharaShow(this.cutScene);
	}

	// Token: 0x06000B65 RID: 2917 RVA: 0x00042910 File Offset: 0x00040B10
	public override void Load(TagText.Element element, int order)
	{
		base.Load(element, order);
		Vector3 zero = Vector3.zero;
		element.GetVal(ref this.chara, "chara", 0);
		TagTextUtility.Load_String(ref this.wear, element, "wear", 0);
		TagTextUtility.Load_String(ref this.tin, element, "tin", 0);
		TagTextUtility.Load_String(ref this.gag, element, "gag", 0);
		TagTextUtility.Load_String(ref this.restrict, element, "restrict", 0);
		TagTextUtility.Load_String(ref this.skirtFlick, element, "skirtFlick", 0);
		TagTextUtility.Load_String(ref this.show, element, "show", 0);
	}

	// Token: 0x06000B66 RID: 2918 RVA: 0x000429B0 File Offset: 0x00040BB0
	public override void Save(TagText.Element element)
	{
		base.Save(element);
		element.AddAttribute("chara", this.chara);
		if (this.wear.Length > 0)
		{
			element.AddAttribute("wear", this.wear);
		}
		if (this.tin.Length > 0)
		{
			element.AddAttribute("tin", this.tin);
		}
		if (this.gag.Length > 0)
		{
			element.AddAttribute("gag", this.gag);
		}
		if (this.restrict.Length > 0)
		{
			element.AddAttribute("restrict", this.restrict);
		}
		if (this.skirtFlick.Length > 0)
		{
			element.AddAttribute("skirtFlick", this.skirtFlick);
		}
		if (this.show.Length > 0)
		{
			element.AddAttribute("show", this.show);
		}
	}

	// Token: 0x06000B67 RID: 2919 RVA: 0x00042AA4 File Offset: 0x00040CA4
	public override void Action(bool skip)
	{
		Human human = this.cutScene.GetHuman(this.chara);
		if (this.wear.Length > 0)
		{
			if (human.sex == SEX.FEMALE)
			{
				if (string.Equals(this.wear, "WEAR", StringComparison.OrdinalIgnoreCase))
				{
					WEAR_SHOW wear_SHOW = WEAR_SHOW.ALL;
					for (WEAR_SHOW_TYPE wear_SHOW_TYPE = WEAR_SHOW_TYPE.TOPUPPER; wear_SHOW_TYPE < WEAR_SHOW_TYPE.NUM; wear_SHOW_TYPE++)
					{
						human.wears.ChangeShow(wear_SHOW_TYPE, wear_SHOW);
					}
				}
				else if (string.Equals(this.wear, "UNDERWEAR", StringComparison.OrdinalIgnoreCase))
				{
					human.wears.ChangeShow(WEAR_SHOW_TYPE.TOPUPPER, WEAR_SHOW.HIDE);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.TOPLOWER, WEAR_SHOW.HIDE);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.BOTTOM, WEAR_SHOW.HIDE);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.BRA, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SHORTS, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIMUPPER, WEAR_SHOW.HIDE);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIMLOWER, WEAR_SHOW.HIDE);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_TOPUPPER, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_TOPLOWER, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_BOTTOM, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.GLOVE, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.PANST, WEAR_SHOW.ALL);
					human.wears.ChangeShow(WEAR_SHOW_TYPE.SOCKS, WEAR_SHOW.ALL);
				}
				else if (string.Equals(this.wear, "HALF", StringComparison.OrdinalIgnoreCase))
				{
					WEAR_SHOW wear_SHOW = WEAR_SHOW.HALF;
					for (WEAR_SHOW_TYPE wear_SHOW_TYPE2 = WEAR_SHOW_TYPE.TOPUPPER; wear_SHOW_TYPE2 < WEAR_SHOW_TYPE.NUM; wear_SHOW_TYPE2++)
					{
						human.wears.ChangeShow(wear_SHOW_TYPE2, wear_SHOW);
					}
				}
				else if (string.Equals(this.wear, "HIDE", StringComparison.OrdinalIgnoreCase) || string.Equals(this.wear, "NUDE", StringComparison.OrdinalIgnoreCase))
				{
					WEAR_SHOW wear_SHOW = WEAR_SHOW.HIDE;
					for (WEAR_SHOW_TYPE wear_SHOW_TYPE3 = WEAR_SHOW_TYPE.TOPUPPER; wear_SHOW_TYPE3 < WEAR_SHOW_TYPE.NUM; wear_SHOW_TYPE3++)
					{
						human.wears.ChangeShow(wear_SHOW_TYPE3, wear_SHOW);
					}
				}
				if (this.skirtFlick.Length > 0)
				{
					bool flag = bool.Parse(this.skirtFlick);
					WEAR_SHOW wear_SHOW2 = human.wears.GetShow(WEAR_SHOW_TYPE.BOTTOM, false);
					if (wear_SHOW2 == WEAR_SHOW.ALL && flag)
					{
						human.wears.ChangeShow(WEAR_SHOW_TYPE.BOTTOM, WEAR_SHOW.HALF);
					}
					else if (wear_SHOW2 == WEAR_SHOW.HALF && !flag)
					{
						human.wears.ChangeShow(WEAR_SHOW_TYPE.BOTTOM, WEAR_SHOW.ALL);
					}
				}
				human.CheckShow();
			}
			else
			{
				MALE_SHOW male_SHOW = MALE_SHOW.CLOTHING;
				if (string.Equals(this.wear, "HIDE", StringComparison.OrdinalIgnoreCase) || string.Equals(this.wear, "NUDE", StringComparison.OrdinalIgnoreCase))
				{
					male_SHOW = MALE_SHOW.NUDE;
				}
				Male male = human as Male;
				male.ChangeMaleShow(male_SHOW);
			}
		}
		if (this.tin.Length > 0 && human.sex == SEX.MALE)
		{
			Male male2 = human as Male;
			bool showTinWithWear = string.Equals(this.tin, "SHOW", StringComparison.OrdinalIgnoreCase);
			male2.SetShowTinWithWear(showTinWithWear);
		}
		if (this.gag.Length > 0 && human.sex == SEX.FEMALE)
		{
			Female female = human as Female;
			if (string.Equals(this.gag, "BallGag", StringComparison.OrdinalIgnoreCase) || string.Equals(this.gag, "GagBall", StringComparison.OrdinalIgnoreCase))
			{
				female.personality.gagItem = GAG_ITEM.BALLGAG;
				female.ChangeGagItem();
				female.ChangeShowGag(true);
			}
			else if (string.Equals(this.gag, "GumTape", StringComparison.OrdinalIgnoreCase))
			{
				female.personality.gagItem = GAG_ITEM.GUMTAPE;
				female.ChangeGagItem();
				female.ChangeShowGag(true);
			}
			else
			{
				female.personality.gagItem = GAG_ITEM.NONE;
				female.ChangeGagItem();
			}
		}
		if (this.restrict.Length > 0)
		{
			bool set = bool.Parse(this.restrict);
			human.ChangeRestrict(set);
		}
		if (this.show.Length > 0)
		{
			bool flag2 = true;
			if (this.show.Equals("hide", StringComparison.OrdinalIgnoreCase) || this.show.Equals("false", StringComparison.OrdinalIgnoreCase) || this.show.Equals("off", StringComparison.OrdinalIgnoreCase))
			{
				flag2 = false;
			}
			if (human.sex == SEX.FEMALE)
			{
				Female female2 = human as Female;
				female2.body.SetShowTongue(flag2);
				female2.head.ChangeShow(flag2);
				female2.head.SetShowTongue(flag2);
				female2.hairs.ChangeShow(flag2);
				female2.accessories.ChangeAllShow(flag2);
				female2.wears.CheckShow(flag2);
				female2.body.ShowUnderHair(flag2);
				female2.ShowMosaic(flag2);
				female2.body.ShowNail(flag2);
			}
			else
			{
				Male male3 = human as Male;
				MALE_SHOW male_SHOW2 = (!flag2) ? MALE_SHOW.HIDE : MALE_SHOW.CLOTHING;
				male3.ChangeMaleShow(male_SHOW2);
			}
		}
	}

	// Token: 0x04000BA9 RID: 2985
	public string chara = string.Empty;

	// Token: 0x04000BAA RID: 2986
	public string wear = string.Empty;

	// Token: 0x04000BAB RID: 2987
	public string tin = string.Empty;

	// Token: 0x04000BAC RID: 2988
	public string gag = string.Empty;

	// Token: 0x04000BAD RID: 2989
	public string restrict = string.Empty;

	// Token: 0x04000BAE RID: 2990
	public string skirtFlick = string.Empty;

	// Token: 0x04000BAF RID: 2991
	public string show = string.Empty;
}
